﻿{include file="Main/menu" /}
<div class="tpl-portlet-components">
	<div class="tpl-block">
		<div class="am-g">
			<div class="am-u-sm-12 am-u-md-6">
				<div class="am-btn-toolbar">
					<div class="am-btn-group am-btn-group-xs">
						<script>
							//city 参数和回调
							var pid="{:input('get.pid')}";
							var cid="{:input('get.cid')}";
							var aid="{:input('get.aid')}";
							var selectc=true;
							var selecta=true;
							function select_p(){
                                return false;
							}
							function select_c(){
                                return false;
							}
							function select_a(){
                                location.href="?pid="+pid+"&cid="+cid+"&aid="+aid;
							}
						</script>
						<button type="button" class="am-btn am-btn-default am-btn-success" onclick="Select_All()">{:lang('currency')['all_select']}</button>
						<a type="button" class="am-btn am-btn-default am-btn-secondary" href="javascript:show_set('edit')" /><span class="am-icon-plus"></span>{:lang('currency')['add']}</a>
						<a id="select_del" type="button" class="am-btn am-btn-default am-btn-warning" /><span class="am-icon-trash-o"></span>{:lang('currency')['del']}</a>
						<div class="am-u-sm-12 am-u-md-3">
							<div class="am-form-group" style="width: 300px; font-size: 13px; line-height: 28px;">
								城市：{include file="public/city" /}
							</div>
						</div>
					</div>
				</div>
			</div>
			<!--<div class="am-u-sm-12 am-u-md-3">
				<div class="am-input-group am-input-group-sm">
					<input type="text" class="am-form-field" id="text" value="{:input('get.phone')}">
					<span class="am-input-group-btn">
						<button id="search" class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="button"></button>
					</span>
				</div>
			</div>-->
		</div>
		<div class="am-g">
			<div class="am-u-sm-12">
					<table class="am-table am-table-striped am-table-hover table-main">
						<tr>
							<th width="60">{:lang('label')['select']}</th>
							<th width="120">{:lang('label')['type']}</th>
							<th width="120">{:lang('label')['username']}</th>
							<th width="200">{:lang('label')['phone']}</th>
							<th width="100">{:lang('label')['handle']}</th>
						</tr>
						{volist name="data" id="auth"}
							<tr>
								<td >
									<input type="checkbox" name="box" value="{$auth.id}" />
								</td>
								<td>{if $auth.type == 'all'}总管理{else}城市管理{/if}</td>
								<td>{$auth.username}</td>
								<td>{$auth.phone}</td>
								<td>
									<a href="javascript:show_set('edit?id={$auth.id}')"><button class="am-btn am-btn-default am-btn-xs am-text-secondary">{:lang('currency')['edit']}</button></a>
									<a href="del?id={$auth.id}&page={:input('get.page')}" onclick="if(confirm('{:lang('currency')['del']}?')){return true;}return false;"><button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only">{:lang('currency')['del']}</button></a>
								</td>
							</tr>
						{/volist}
						</tbody>
					</table>
					{include file="public/pages" /}
			</div>
		</div>
	</div>
</div>
<script>
layer.config({
	extend: 'extend/layer.ext.js'
});
$('#select_del').click(function(){
	var str="";
	$("input:checkbox[name=box]:checked").each(function(){
		str+=$(this).val()+",";
	});
	if(str!=''){
	      if(confirm('{:lang('currency')['del']}?')){
                    location.href='del.html?id='+str;
               }
	}
});
$('#search').click(function(){
	var val = $("#text").val();
	location.href="?phone="+val;
});
function Select_All() {
	var box = $("input[name='box']");
	for (var i in box){
	    box[i].checked = !box[i].checked;
	}
}
function show_set(url) {
	layer.open({
		type:2,
		title:'',
        area: ['60%', '95%'],
		content:url
	})
}
</script>
{include file="Main/menu_footer" /}